from django.contrib.auth.models import Group
from rest_framework.viewsets import ModelViewSet

from apps.meiduo_admin.serializers.group import Groupserializer
from apps.users.models import User

from apps.meiduo_admin.serializers.manager import ManagerSerializer
from apps.meiduo_admin.utils import PageNum
from rest_framework.generics import ListAPIView


class ManagerModelViewSet(ModelViewSet):
    queryset =  User.objects.filter(is_staff=True)
    # queryset=User.objects.all()
    serializer_class =ManagerSerializer
    pagination_class = PageNum




class GetManagerGroup(ListAPIView):
    queryset = Group.objects.all()
    serializer_class = Groupserializer